#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n = 0;
	int i = 0;
	int left = 0;
	int right = 0;
	int arr[10];
	scanf("%d", &n);
	right = n - 1;
	for (i = 0;i < n;i++)
	{
		scanf("%d", &arr[i]);
	}
	while (left < right)
	{
		while (left < right)
		{
			if (arr[left] % 2 == 0)
			{
				break;
			}
			left++;
		}
		while (left < right)
		{
			if (arr[right] % 2 == 1)
			{
				break;
			}
			right--;
		}
		if (left < right)
		{
			int temp = arr[left];
			arr[left] = arr[right];
			arr[right] = temp;
		}
	}
	for (i = 0;i < n;i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}